package o;

import android.os.Bundle;
import android.text.TextUtils;
import com.huawei.appmarket.service.activitydispatcher.OpenGateway.Param;
import com.huawei.appmarket.service.activitydispatcher.OpenGateway.c;
import com.huawei.appmarket.service.activitydispatcher.OpenGateway.d;
import com.huawei.appmarket.service.activitydispatcher.OpenGateway.e;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class dpg extends e {
    private static final Map<String, d> ˏ = new HashMap();

    public static void ॱ(String str) {
        ˏ.put(str, null);
    }

    public static void ˊ(String str, d dVar) {
        ˏ.put(str, dVar);
    }

    public c ˋ(String str, List<Param> list, boolean z) {
        if (TextUtils.isEmpty(str)) {
            Logger.e("ActivityUriProvider", "activityUri is NULL");
            return null;
        } else if (!z || ˏ.containsKey(str)) {
            List ॱ;
            d dVar = (d) ˏ.get(str);
            if (dVar != null) {
                ॱ = dVar.ॱ(list);
            }
            if (!z || dVar == null || dVar.ˋ(ॱ)) {
                if (dVar != null) {
                    fjb ˏ = dVar.ˏ(ॱ);
                    if (ˏ != null) {
                        c cVar = new c();
                        c.c cVar2 = new c.c();
                        cVar2.ˋ = ˏ;
                        cVar.ˋ(cVar2);
                        return cVar;
                    }
                }
                if (cjl.ˏ(str) == null) {
                    Logger.e("ActivityUriProvider", "can not find activityUri:" + str);
                    return null;
                }
                cjm o_cjm;
                c cVar3 = new c();
                if (ॱ != null) {
                    Bundle bundle = new Bundle();
                    if (e.ˎ(ॱ, bundle)) {
                        o_cjm = new cjm(str, new cjq(str).ˊ(bundle).ˏ());
                    } else {
                        Logger.e("ActivityUriProvider", "param error,goMainActivity");
                        return null;
                    }
                }
                o_cjm = new cjm(str, new cjq(str).ˎ().ˏ());
                cVar3.ˏ(o_cjm);
                return cVar3;
            }
            Logger.ˎ("ActivityUriProvider", "param limited.");
            return null;
        } else {
            Logger.ˎ("ActivityUriProvider", "activityUri limited.");
            return null;
        }
    }
}
